package org.eclipse.unofficial.flexitabs;

import org.eclipse.unofficial.flexitabs.adapted.FlexiPane;
import org.eclipse.unofficial.flexitabs.adapted.FlexiPart;
import org.eclipse.unofficial.flexitabs.internal.PartPane;
import org.eclipse.unofficial.flexitabs.internal.WorkbenchPage;
import org.eclipse.unofficial.flexitabs.internal.WorkbenchPartReference;

import org2.eclipse.ui.IWorkbenchPage;
import org2.eclipse.ui.IWorkbenchPart;
import org2.eclipse.ui.internal.WorkbenchWindow;


public class FlexiTab extends WorkbenchPartReference {
	private FlexiTabClient client;
	private WorkbenchPage page;
	
	WorkbenchWindow window;
	
	public FlexiTab(FlexiTabClient client, WorkbenchPage page) {
		this.client = client;
		this.page = page;
	}
	
	public FlexiTabClient getClient() {
		return client;
	}
	
	@Override
	public IWorkbenchPage getPage() {
		return null;
	}

	@Override
	protected IWorkbenchPart createPart() {
		return new FlexiPart(this);
	}

	@Override
	protected PartPane createPane() {
		return new FlexiPane(this, page);
	}

	public void setText(String title) {
		((FlexiPart) this.getPart(false)).setText(title);
	}
}
